import random, string




ascii = string.ascii_uppercase.replace('I','').replace('O', '').replace('L', '').replace('Z', '')
digits = string.digits.replace('1', '').replace('0','').replace('9','').replace('6','')


char_set = ascii + digits
def random_string(length):
    return ''.join(random.sample(char_set, length))
    

list_a = [random_string(6) for i in range(100000)]

list_b = [random_string(6) for i in range(100000)]

print set(list_a).intersection(set(list_b))